import { PlanInfo, ApiResponse } from './types';

// 模拟API响应数据
const mockPlanInfo: PlanInfo = {
  systemName: "LV01.11 测试系统-01",
  implementationTime: "2025 05 01 - 2025 06 30",
  isReporting: true,
  contactPerson: "朱文熹YC02753",
  content: "这是测试的你",
  businessImpact: "这是测试的你",
  otherNotes: ""
};

/**
 * 获取投产规划数据
 */
export const fetchPlanData = async (): Promise<ApiResponse<PlanInfo>> => {
  // 模拟API请求延迟
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve({
        success: true,
        data: mockPlanInfo
      });
    }, 500);
  });
};

/**
 * 保存投产规划数据
 * @param planInfo 投产规划信息
 */
export const savePlanData = async (planInfo: PlanInfo): Promise<ApiResponse> => {
  // 模拟API请求延迟
  return new Promise((resolve) => {
    setTimeout(() => {
      console.log('保存投产规划数据:', planInfo);
      resolve({
        success: true,
        message: '保存成功'
      });
    }, 800);
  });
}; 